
\documentclass[tikz,border=10pt]{standalone}


\RequirePackage{luatex85}
\usepackage[utf8]{inputenc}
\usepackage{amsmath, amssymb, amsfonts, accents}
\usetikzlibrary{graphdrawing, graphs, arrows, shapes, automata, calc}
\usegdlibrary{trees, layered}
\usepackage{stix}


%\newcommand{\Xund}{\rule{.4em}{.4pt}}
%\newcommand{\IRE}{I\!RE}

\newcommand{\Xund}{\rule{.4em}{.4pt}}
\newcommand{\Xl}{\langle}
\newcommand{\Xr}{\rangle}
\newcommand{\Xm}{\langle\!\rangle}


\begin{document}


\begin{tikzpicture}[>=stealth, auto, sibling distance = 0.2in, inner sep = 1pt, outer sep = 0pt]
%\begin{tikzpicture}[>=stealth]

\tikzstyle{every node}=[draw=none, shape=rectangle]


\tikzstyle{styleA}=[draw=none
    , shape=rectangle
    , minimum size = 0.2in
    , level distance=0.35in
    , sibling distance=0.5in
    , inner sep = 0pt
    , outer sep = 0pt
    ]
\tikzstyle{styleB}=[->, rounded corners=3, dash pattern = on 1pt off 2.5pt]
\newcommand\w{\hspace{2em}}


\small{
\begin{scope}[xshift=0in, yshift=0in]
    \tikzstyle{every node}=[styleA, sibling distance = 0.5in]

    \begin{scope}[xshift=-0.5in, yshift=0in]
    \node[xshift=0in, yshift=-1.2in, draw=none] {$s = T^1 (T^2 (\varnothing^0, T^0 (a^0, a^0)))$};
    \graph [tree layout, grow=down, fresh nodes] {
        s1/"${T}^{1}$" -- {
            s11/"${T}^{2}$" -- {
                s111/"${\varnothing}^{0}$",
                s112/"${T}^{0}$" -- {
                    s1121/"${a}^{0}$",
                    s1122/"${a}^{0}$"
                }
            }
        }
    };
    \node at (s1)   {$\Xl_1 \w \Xr_0$};
    \node at (s11)  {$\Xl_2 \w \Xr_1$};
    \draw [styleB]
        ($(s1.west)$)
        -- ($(s11.west)$)
        -- ($(s111.west)$)
        -- ($(s111.south)$)
        -- ($(s111.east)$)
        -- ($(s11.south)$)
        -- ($(s112.west)$)
        -- ($(s1121.west)$);
    \draw [styleB]
        ($(s1121.east)$)
        -- ($(s112.south)$)
        -- ($(s1122.west)$);
    \draw [styleB]
        ($(s1122.east)$)
        -- ($(s112.east)$)
        -- ($(s11.east)$)
        -- ($(s1.east)$);
    \end{scope}

    \begin{scope}[xshift=1in, yshift=0in]
    \node[xshift=0in, yshift=-0.9in, draw=none] {$t = T^1 (T^2 (a^0, \varnothing^0), T^2 (a^0, \varnothing^0))$};
    \graph [tree layout, grow=down, fresh nodes] {
        s1/"${T}^{1}$" -- {
            s11/"${T}^{2}$" -- {
                s111/"${a}^{0}$",
                s112/"${\varnothing}^{0}$"
            },
            s12/"${T}^{2}$" -- {
                s121/"${a}^{0}$",
                s122/"${\varnothing}^{0}$"
            }
        }
    };
    \node at (s1)   {$\Xl_1 \w \Xr_0$};
    \node at (s11)  {$\Xl_2 \w \Xr_1$};
    \node at (s12)  {$\Xl_2 \w \Xr_1$};
    \draw [styleB]
        ($(s1.west)$)
        -- ($(s11.west)$)
        -- ($(s111.west)$);
    \draw [styleB]
        ($(s111.east)$)
        -- ($(s11.south)$)
        -- ($(s112.west)$)
        -- ($(s112.south)$)
        -- ($(s112.east)$)
        -- ($(s11.east)$)
        -- ($(s1.south)$)
        -- ($(s12.west)$)
        -- ($(s121.west)$);
    \draw [styleB]
        ($(s121.east)$)
        -- ($(s12.south)$)
        -- ($(s122.west)$)
        -- ($(s122.south)$)
        -- ($(s122.east)$)
        -- ($(s12.east)$)
        -- ($(s1.east)$);
    \end{scope}

    \begin{scope}[xshift=2.7in, yshift=-0.2in]
        \node (a) {
        $\begin{aligned}
            \alpha = \Phi_0(s) &=
                \overbracket {\Xl_1 \Xl_2 }
                a
                \overbracket {\vphantom{\Xm}}
                a
                \overbracket { \Xr_1 \Xr_0 }
                \\[-0.4em]
            \beta = \Phi_0(t) &=
                \overbracket {\Xl_1 \Xl_2 }
                a
                \overbracket { \Xr_1 \Xl_2 }
                a
                \overbracket { \Xr_1 \Xr_0 }
        \end{aligned}$
        };
    \end{scope}

    \begin{scope}[xshift=5in, yshift=-0.4in]
        \node (a) {
        $\begin{aligned}
        tr&aces (\alpha, \beta) : \\[-0.4em]
        &\left[\begin{aligned}
            \rho_0   &= \rho'_0 = -1 \\[-0.4em]
            \rho_1   &= min (lasth(\Xl_1 \Xl_2), minh (\epsilon))    = min (2, \infty) = 2 \\[-0.4em]
            \rho'_1  &= min (lasth(\Xl_1 \Xl_2), minh (\Xr_1 \Xl_2)) = min (2, 1)      = 1 \\[-0.4em]
            \rho_2   &= min (\rho_1,  minh (\Xr_1 \Xr_0)) = min (2, 0) = 0 \\[-0.4em]
            \rho'_2  &= min (\rho'_1, minh (\Xr_1 \Xr_0)) = min (1, 0) = 0
        \end{aligned}\right.
        \end{aligned}$
        };
    \end{scope}

    \begin{scope}[xshift=4in, yshift=-1.05in]
        \node (a) {
        $\begin{aligned}
        &\rho_1 > \rho'_1 \;\wedge\; \rho_2 = \rho'_2
            \;\Rightarrow\; \alpha \sqsubset \beta
            \;\Rightarrow\; \alpha < \beta
        \\[-0.3em]
        \|s\|^{Sub}_1 = 2 &> 1 = \|t\|^{Sub}_1 \wedge \|s\|^{Sub}_p = \|t\|^{Sub}_p \;\forall p < 1
            \;\Rightarrow\; s <_1 t
        \end{aligned}$
        };
    \end{scope}
\end{scope}
}
\normalsize{
\node (x1)
    [ xshift=2.7in
    , yshift=-1.4in
    , draw=none
    ] {(a) -- Rule 1: longest precedence, RE $(a|aa)^{0,\infty}$ and string $aa$.
    };
}


\small{
\begin{scope}[xshift=0in, yshift=-1.9in]
    \tikzstyle{every node}=[styleA, sibling distance = 0.5in]

    \begin{scope}[xshift=-0.5in, yshift=0in]
    \node[xshift=0in, yshift=-0.6in, draw=none] {$s = T^1 (a^2, \varnothing^3)$};
    \graph [tree layout, grow=down, fresh nodes] {
        r1/"${T}^{1}$" -- {
            r11/"${a}^{2}$",
            r12/"${\varnothing}^{3}$"
        }
    };
    \node at (r1)  {$\Xl_1 \w \Xr_0$};
    \node at (r11) {$\Xl_2 \w \Xr_1$};
    \node at (r12) {$\hphantom{\Xl_2} \w \Xm_1$};
    \draw [styleB]
        ($(r1.west)$)
        -- ($(r11.west)$);
    \draw [styleB]
        ($(r11.east)$)
        -- ($(r1.south)$)
        -- ($(r12.west)$)
        -- ($(r12.south)$)
        -- ($(r12.east)$)
        -- ($(r1.east)$);
    \end{scope}

    \begin{scope}[xshift=1in, yshift=0in]
    \node[xshift=0in, yshift=-0.6in, draw=none] {$t = T^1 (\varnothing^2, a^3)$};
    \graph [tree layout, grow=down, fresh nodes] {
        t1/"${T}^{1}$" -- {
            t11/"${\varnothing}^{2}$",
            t12/"${a}^{3}$"
        }
    };
    \node at (t1)  {$\Xl_1 \w \Xr_0$};
    \node at (t11) {$\hphantom{\Xl_2} \w \Xm_1$};
    \node at (t12) {$\Xl_2 \w \Xr_1$};
    \draw [styleB]
        ($(t1.west)$)
        -- ($(t11.west)$)
        -- ($(t11.south)$)
        -- ($(t11.east)$)
        -- ($(t1.south)$)
        -- ($(t12.west)$);
    \draw [styleB]
        ($(t12.east)$)
        -- ($(t1.east)$);
    \end{scope}

    \begin{scope}[xshift=2.7in, yshift=-0.0in]
        \node (a) {
        $\begin{aligned}
            \alpha = \Phi_0(s) &=
                \overbracket {\Xl_1 \Xl_2 }
                a
                \overbracket { \Xr_1 \Xm_1 \Xr_0 }
                \\[-0.4em]
            \beta = \Phi_0(t) &=
                \overbracket {\Xl_1 \Xm_1 \Xl_2 }
                a
                \overbracket { \Xr_1 \Xr_0 }
        \end{aligned}$
        };
    \end{scope}

    \begin{scope}[xshift=5in, yshift=-0.1in]
        \node (a) {
        $\begin{aligned}
        tr&aces (\alpha, \beta) : \\[-0.4em]
        &\left[\begin{aligned}
            \rho_0   &= min (lasth (\Xl_1), minh (\Xl_2))       = min (1, 2) = 1 \\[-0.4em]
            \rho'_0  &= min (lasth (\Xl_1), minh (\Xm_1 \Xl_2)) = min (1, 1) = 1 \\[-0.4em]
            \rho_1   &= min (\rho_0,  minh (\Xr_1 \Xm_1 \Xr_0)) = min (1, 0) = 0 \\[-0.4em]
            \rho'_1  &= min (\rho'_0, minh (\Xr_1 \Xr_0))       = min (1, 0) = 0
        \end{aligned}\right.
        \end{aligned}$
        };
    \end{scope}

    \begin{scope}[xshift=4in, yshift=-0.7in]
        \node (a) {
        $\begin{aligned}
        \rho_i = \rho'_i &\;\forall i
            \;\wedge\; first(\alpha \backslash \beta) = \Xl < \Xm = first(\beta \backslash \alpha)
            \;\Rightarrow\; \alpha \sim \beta \;\wedge\; \alpha \subset \beta
            \;\Rightarrow\; \alpha < \beta
        \\[-0.3em]
        &\|s\|^{Sub}_1 = 1 > -1 = \|t\|^{Sub}_1 \wedge \|s\|^{Sub}_p = \|t\|^{Sub}_p \;\forall p < 1
            \;\Rightarrow\; s <_1 t
        \end{aligned}$
        };
    \end{scope}
\end{scope}
}
\normalsize{
\node (y1)
    [ xshift=2.7in
    , yshift=-2.95in
    , draw=none
    ] {(b) -- Rule 2: leftmost precedence, RE $(a)|(a)$ and string $a$.
    };
}


\small{
\begin{scope}[xshift=0in, yshift=-3.3in]
    \tikzstyle{every node}=[styleA, sibling distance = 0.5in]

    \begin{scope}[xshift=-0.5in, yshift=0in]
    \node[yshift=-0.9in, draw=none] {$s = T^1(T^2(a^0, \varnothing^0))$};
    \graph [tree layout, grow=down, fresh nodes] {
        s1/"${T}^{1}$" -- {
            s11/"${T}^{2}$" -- {
                s111/"${a}^{0}$",
                s112/"${\varnothing}^{0}$"
            }
        }
    };
    \node at (s1)   {$\Xl_1 \w \Xr_0$};
    \node at (s11)  {$\Xl_2 \w \Xr_1$};
    \node at (s12)  {$\Xl_2 \w \Xr_1$};
    \draw [styleB]
        ($(s1.west)$)
        -- ($(s11.west)$)
        -- ($(s111.west)$);
    \draw [styleB]
        ($(s111.east)$)
        -- ($(s11.south)$)
        -- ($(s112.west)$)
        -- ($(s112.south)$)
        -- ($(s112.east)$)
        -- ($(s11.east)$)
        -- ($(s1.east)$);
    \end{scope}

    \begin{scope}[xshift=1in, yshift=0in]
    \node[xshift=0in, yshift=-0.9in, draw=none] {$t = T^1 (T^2 (a^0, \varnothing^0), T^2(\varnothing^0, \epsilon^0))$};
    \graph [tree layout, grow=down, fresh nodes] {
        s1/"${T}^{1}$" -- {
            s11/"${T}^{2}$" -- {
                s111/"${a}^{0}$",
                s112/"${\varnothing}^{0}$"
            },
            s12/"${T}^{2}$" -- {
                s121/"${\varnothing}^{0}$",
                s122/"${\epsilon}^{0}$"
            }
        }
    };
    \node at (s1)   {$\Xl_1 \w \Xr_0$};
    \node at (s11)  {$\Xl_2 \w \Xr_1$};
    \node at (s12)  {$\Xl_2 \w \Xr_1$};
    \draw [styleB]
        ($(s1.west)$)
        -- ($(s11.west)$)
        -- ($(s111.west)$);
    \draw [styleB]
        ($(s111.east)$)
        -- ($(s11.south)$)
        -- ($(s112.west)$)
        -- ($(s112.south)$)
        -- ($(s112.east)$)
        -- ($(s11.east)$)
        -- ($(s1.south)$)
        -- ($(s12.west)$)
        -- ($(s121.west)$)
        -- ($(s121.south)$)
        -- ($(s121.east)$)
        -- ($(s12.south)$)
        -- ($(s122.west)$)
        -- ($(s122.south)$)
        -- ($(s122.east)$)
        -- ($(s12.east)$)
        -- ($(s1.east)$);
    \end{scope}

    \begin{scope}[xshift=2.7in, yshift=-0.2in]
        \node (a) {
        $\begin{aligned}
            \alpha = \Phi_0(s) &=
                \overbracket {\Xl_1 \Xl_2 }
                a
                \overbracket { \Xr_1 \Xr_0 }
                \\[-0.4em]
            \beta = \Phi_0(t) &=
                \overbracket { \Xl_1 \Xl_2 }
                a
                \overbracket { \Xr_1 \Xl_2 \Xr_1 \Xr_0 }
        \end{aligned}$
        };
    \end{scope}

    \begin{scope}[xshift=5in, yshift=-0.2in]
        \node (a) {
        $\begin{aligned}
        tr&aces (\alpha, \beta) :
        \\[-0.4em]
        &\left[\begin{aligned}
            \rho_0   &= \rho'_0 = -1 \\[-0.4em]
            \rho_1   &= min (lasth (\Xr_1), minh (\Xr_0))             = min (1, 0) = 0 \\[-0.4em]
            \rho'_1  &= min (lasth (\Xr_1), minh (\Xl_2 \Xr_1 \Xr_0)) = min (1, 0) = 0
        \end{aligned}\right.
        \end{aligned}$
        };
    \end{scope}

    \begin{scope}[xshift=4in, yshift=-0.75in]
        \node (a) {
        $\begin{aligned}
        \rho_i = \rho'_i \;\forall i
            &\;\wedge\; first(\alpha \backslash \beta) = \Xr < \Xl = first(\beta \backslash \alpha)
            \;\Rightarrow\; \alpha \sim \beta \;\wedge\; \alpha \subset \beta
            \;\Rightarrow\; \alpha < \beta
        \\[-0.3em]
        &\|s\|^{Sub}_2 = \infty > 0 = \|t\|^{Sub}_2 \wedge \|s\|^{Sub}_p = \|t\|^{Sub}_p \;\forall p < 2
            \;\Rightarrow\; s <_2 t
        \end{aligned}$
        };
    \end{scope}
\end{scope}
}
\normalsize{
\node (z1)
    [ xshift=2.7in
    , yshift=-4.45in
    , draw=none
    ] {(c) -- Rule 3: no optional empty repetitions,
        RE $(a|\epsilon)^{0,\infty}$ and string $a$.
        };
}


\small{
\begin{scope}[xshift=0in, yshift=-4.85in]
    \tikzstyle{every node}=[styleA, sibling distance = 0.5in]

    \begin{scope}[xshift=-0.5in, yshift=0in]
    \node[yshift=-0.6in, draw=none] {$s = T^1(\varnothing^2)$};
    \graph [tree layout, grow=down, fresh nodes] {
        s1/"${T}^{1}$" -- {
            s11/"${\varnothing}^{2}$"
        }
    };
    \node at (s1)   {$\Xl_1 \w \Xr_0$};
    \node at (s11)  {$\hphantom{\Xl_2} \w \Xm_1$};
    \draw [styleB]
        ($(s1.west)$)
        -- ($(s11.west)$)
        -- ($(s11.south)$)
        -- ($(s11.east)$)
        -- ($(s1.east)$);
    \end{scope}

    \begin{scope}[xshift=1in, yshift=0in]
    \node[xshift=0in, yshift=-0.9in, draw=none] {$t = T^1(T^2(\epsilon^0))$};
    \graph [tree layout, grow=down, fresh nodes] {
        s1/"${T}^{1}$" -- {
            s11/"${T}^{2}$" -- {
                s111/"${\varnothing}^{0}$",
                s112/"${\epsilon}^{0}$"
            }
        }
    };
    \node at (s1)   {$\Xl_1 \w \Xr_0$};
    \node at (s11)  {$\Xl_2 \w \Xr_1$};
    \draw [styleB]
        ($(s1.west)$)
        -- ($(s11.west)$)
        -- ($(s111.west)$)
        -- ($(s111.south)$)
        -- ($(s111.east)$)
        -- ($(s11.south)$)
        -- ($(s112.west)$)
        -- ($(s112.south)$)
        -- ($(s112.east)$)
        -- ($(s11.east)$)
        -- ($(s1.east)$);
    \end{scope}

    \begin{scope}[xshift=2.7in, yshift=-0.2in]
        \node (a) {
        $\begin{aligned}
            \alpha = \Phi_0(s) &=
                \overbracket {\Xl_1 \Xm_1 \Xr_0 }
                \\[-0.4em]
            \beta = \Phi_0(t) &=
                \overbracket {\Xl_1 \Xl_2 \Xr_1 \Xr_0 }
        \end{aligned}$
        };
    \end{scope}

    \begin{scope}[xshift=5in, yshift=-0.2in]
        \node (a) {
        $\begin{aligned}
        tr&aces (\alpha, \beta) :
        \\[-0.4em]
        &\left[\begin{aligned}
            \rho_0   &= min (lasth (\Xl_1), minh (\Xm_1 \Xr_0))       = min (1, 0) = 0 \\[-0.4em]
            \rho'_0  &= min (lasth (\Xl_1), minh (\Xl_2 \Xr_1 \Xr_0)) = min (1, 0) = 0
        \end{aligned}\right.
        \end{aligned}$
        };
    \end{scope}

    \begin{scope}[xshift=4in, yshift=-0.7in]
        \node (a) {
        $\begin{aligned}
        \rho_i = \rho'_i \;\forall i
            &\;\wedge\; first(\alpha \backslash \beta) = \Xm > \Xl = first(\beta \backslash \alpha)
            \;\Rightarrow\; \alpha \sim \beta \;\wedge\; \beta \subset \alpha
            \;\Rightarrow\; \beta < \alpha
        \\[-0.3em]
        &\|s\|^{Sub}_2 = 0 > -1 = \|s\|^{Sub}_2 \wedge \|s\|^{Sub}_p = \|t\|^{Sub}_p \;\forall p < 2
            \;\Rightarrow\; t <_2 s
        \end{aligned}$
        };
    \end{scope}
\end{scope}
}
\normalsize{
\node (z1)
    [ xshift=2.7in
    , yshift=-6in
    , draw=none
    ] {(d) -- Rule 4: empty match is better than no match,
        RE $(a|\epsilon)^{0,\infty}$ and string $\epsilon$.
        };
}


\tikzstyle{every node}=[draw, shape = circle]

\small{
\begin{scope}[xshift=-0.5in, yshift=-6.4in]

\begin{scope}[xshift=0in, yshift=-0in]
    \tikzstyle{every node}=[draw, shape = circle]
    \graph [tree layout, grow=down, fresh nodes, level distance = 0.1in] {
        "$t_1$" -- {
            "" -- {
                "" -- { "$a$", "$a$", "$a$" }
            }
        }
        , "$t_2$" -- {
            "" -- {
                "" -- { "$a$", "$a$" },
                "" -- { "$a$" }
            }
        }
        , t31/"$t_3$" -- {
            t311/"" -- {
                t3111/"" -- { t31111/"$a$" },
                t3112/"" -- { t31121/"$a$", t31122/"$a$" }
            }
        }
        , "$t_4$" -- {
            "" -- {
                "" -- { "$a$" },
                "" -- { "$a$" },
                "" -- { "$a$" }
            }
        }
        , t51/"$t_5$" -- {
            t511/"" -- {
                t5111/"" -- { t51111/"$a$", t51112/"$a$" }
            },
            t512/"" -- {
                t5121/"" -- { t51211/"$a$" }
            }
        }
        , "$t_6$" -- {
            "" -- {
                "" -- { "$a$" }
            },
            "" -- {
                "" -- { "$a$", "$a$" }
            }
        }
        , "$t_7$" -- {
            "" -- {
                "" -- { "$a$"},
                "" -- { "$a$"}
            },
            "" -- {
                "" -- { "$a$" }
            }
        }
        , "$t_8$" -- {
            "" -- {
                "" -- { "$a$"}
            },
            "" -- {
                "" -- { "$a$"},
                "" -- { "$a$" }
            }
        }
        , "$t_9$" -- {
            "" -- {
                "" -- { "$a$" }
            },
            "" -- {
                "" -- { "$a$" }
            },
            "" -- {
                "" -- { "$a$" }
            }
        }
    };
\end{scope}


\tikzstyle{styleA}=[draw=none
    , shape=circle
    , minimum size = 0.2in
    , inner sep = 0pt
    , outer sep = 0pt
    ]

\tikzstyle{styleB}=[->
    , rounded corners=3.5
    %, color = lightgray
    , dash pattern = on 1pt off 2.5pt
    ]


\begin{scope}[xshift=0in, yshift=-2.2in]
    \tikzstyle{every node}=[draw = none, shape = circle, inner sep = 0]
    \node[xshift=-0.4in, draw=none] {$t_3:$};
    \graph [tree layout, grow=down, fresh nodes, sibling distance = 0.45in, level distance = 0.3in] {
        t31/"$T^1$" -- {
            t311/"$T^2$" -- {
                t3111/"$T^3$" -- { t31111/"$a^4$" },
                t3112/"$T^5$" -- { t31121/"$a^6$", t31122/"$a^7$" }
            }
        }
    };
    \node at (t31)    [styleA] {$\Xl_1 \w \Xr_0$};
    \node at (t311)   [styleA] {$\Xl_2 \w \Xr_1$};
    \node at (t3111)  [styleA] {$\Xl_3 \w \Xr_2$};
    \node at (t3112)  [styleA] {$\Xl_3 \w \Xr_2$};
    \node at (t31111) [styleA] {$\Xl_4 \w \Xr_3$};
    \node at (t31121) [styleA] {$\Xl_4 \w \Xr_3$};
    \node at (t31122) [styleA] {$\Xl_4 \w \Xr_3$};
    %
    \node at (t31)    [styleA] (tt31)    {};
    \node at (t311)   [styleA] (tt311)   {};
    \node at (t3111)  [styleA] (tt3111)  {};
    \node at (t3112)  [styleA] (tt3112)  {};
    \node at (t31111) [styleA] (tt31111) {};
    \node at (t31121) [styleA] (tt31121) {};
    \node at (t31122) [styleA] (tt31122) {};
    %
    \draw [->, styleB] ($(tt31.west)$)
        -- ($(tt311.west)$)
        -- ($(tt3111.west)$)
        -- ($(tt31111.west)$);
    \draw [->, styleB] ($(tt31111.east)$)
        -- ($(tt3111.east)$)
        -- ($(tt311.south)$)
        -- ($(tt3112.west)$)
        -- ($(tt31121.west)$);
    \draw [->, styleB] ($(tt31121.east)$)
        -- ($(tt3112.south)$)
        -- ($(tt31122.west)$);
    \draw [->, styleB] ($(tt31122.east)$)
        -- ($(tt3112.east)$)
        -- ($(tt311.east)$)
        -- ($(tt31.east)$);
\end{scope}


\begin{scope}[xshift=1.6in, yshift=-2.2in]
    \tikzstyle{every node}=[draw = none, shape = circle, inner sep = 0]
    \node[xshift=-0.4in, draw=none] {$t_5:$};
    \graph [tree layout, grow=down, fresh nodes, sibling distance = 0.45in, level distance = 0.3in] {
        t51/"$T^1$" -- {
            t511/"$T^2$" -- {
                t5111/"$T^3$" -- { t51111/"$a^4$", t51112/"$a^5$" }
            },
            t512/"$T^6$" -- {
                t5121/"$T^7$" -- { t51211/"$a^8$" }
            }
        }
    };
    \node at (t51)    [styleA] {$\Xl_1 \w \Xr_0$};
    \node at (t511)   [styleA] {$\Xl_2 \w \Xr_1$};
    \node at (t5111)  [styleA] {$\Xl_3 \w \Xr_2$};
    \node at (t51111) [styleA] {$\Xl_4 \w \Xr_3$};
    \node at (t51112) [styleA] {$\Xl_4 \w \Xr_3$};
    \node at (t512)   [styleA] {$\Xl_2 \w \Xr_1$};
    \node at (t5121)  [styleA] {$\Xl_3 \w \Xr_2$};
    \node at (t51211) [styleA] {$\Xl_4 \w \Xr_3$};
    %
    \node at (t51)    [styleA] (tt51)    {};
    \node at (t511)   [styleA] (tt511)   {};
    \node at (t5111)  [styleA] (tt5111)  {};
    \node at (t51111) [styleA] (tt51111) {};
    \node at (t51112) [styleA] (tt51112) {};
    \node at (t512)   [styleA] (tt512)   {};
    \node at (t5121)  [styleA] (tt5121)  {};
    \node at (t51211) [styleA] (tt51211) {};
    %
    \draw [->, styleB] ($(tt51.west)$)
        -- ($(tt511.west)$)
        -- ($(tt5111.west)$)
        -- ($(tt51111.west)$);
    \draw [->, styleB] ($(tt51111.east)$)
        -- ($(tt5111.south)$)
        -- ($(tt51112.west)$);
    \draw [->, styleB] ($(tt51112.east)$)
        -- ($(tt5111.east)$)
        -- ($(tt511.east)$)
        -- ($(tt51.south)$)
        -- ($(tt512.west)$)
        -- ($(tt5121.west)$)
        -- ($(tt51211.west)$);
    \draw [->, styleB] ($(tt51211.east)$)
        -- ($(tt5121.east)$)
        -- ($(tt512.east)$)
        -- ($(tt51.east)$);
\end{scope}


\begin{scope}[xshift=5.6in, yshift=-2in]
    \node [shape=rectangle, draw = none] (a) {
    $\begin{aligned}
        &\begin{aligned}
            &\Phi_0(t_1) = \overbracket {\Xl_1 \Xl_2 \Xl_3 \Xl_4} a \overbracket {\Xr_3 \Xl_4} a \overbracket {\Xr_3 \Xl_4} a \overbracket {\Xr_3 \Xr_2 \Xr_1 \Xr_0} \\[-0.4em]
            &\Phi_0(t_2) = \overbracket {\Xl_1 \Xl_2 \Xl_3 \Xl_4} a \overbracket {\Xr_3 \Xl_4} a \overbracket {\Xr_3 \Xr_2 \Xl_3 \Xl_4} a \overbracket {\Xr_3 \Xr_2 \Xr_1 \Xr_0} \\[-0.4em]
            &\Phi_0(t_3) = \overbracket {\Xl_1 \Xl_2 \Xl_3 \Xl_4} a \overbracket {\Xr_3 \Xr_2 \Xl_3 \Xl_4} a \overbracket {\Xr_3 \Xl_4} a \overbracket {\Xr_3 \Xr_2 \Xr_1 \Xr_0} \\[-0.4em]
            &\Phi_0(t_4) = \overbracket {\Xl_1 \Xl_2 \Xl_3 \Xl_4} a \overbracket {\Xr_3 \Xr_2 \Xl_3 \Xl_4} a \overbracket {\Xr_3 \Xr_2 \Xl_3 \Xl_4} a \overbracket {\Xr_3 \Xr_2 \Xr_1 \Xr_0} \\[-0.4em]
            &\Phi_0(t_5) = \overbracket {\Xl_1 \Xl_2 \Xl_3 \Xl_4} a \overbracket {\Xr_3 \Xl_4} a \overbracket {\Xr_3 \Xr_2 \Xr_1 \Xl_2 \Xl_3 \Xl_4} a \overbracket {\Xr_3 \Xr_2 \Xr_1 \Xr_0} \\[-0.4em]
            &\Phi_0(t_6) = \overbracket {\Xl_1 \Xl_2 \Xl_3 \Xl_4} a \overbracket {\Xr_3 \Xr_2 \Xr_1 \Xl_2 \Xl_3 \Xl_4} a \overbracket {\Xr_3 \Xl_4} a \overbracket {\Xr_3 \Xr_2 \Xr_1 \Xr_0} \\[-0.4em]
            &\Phi_0(t_7) = \overbracket {\Xl_1 \Xl_2 \Xl_3 \Xl_4} a \overbracket {\Xr_3 \Xr_2 \Xl_3 \Xl_4} a \overbracket {\Xr_3 \Xr_2 \Xr_1 \Xl_2 \Xl_3 \Xl_4} a \overbracket {\Xr_3 \Xr_2 \Xr_1 \Xr_0} \\[-0.4em]
            &\Phi_0(t_8) = \overbracket {\Xl_1 \Xl_2 \Xl_3 \Xl_4} a \overbracket {\Xr_3 \Xr_2 \Xr_1 \Xl_2 \Xl_3 \Xl_4} a \overbracket {\Xr_3 \Xr_2 \Xl_3 \Xl_4} a \overbracket {\Xr_3 \Xr_2 \Xr_1 \Xr_0} \\[-0.4em]
            &\Phi_0(t_9) = \overbracket {\Xl_1 \Xl_2 \Xl_3 \Xl_4} a \overbracket {\Xr_3 \Xr_2 \Xr_1 \Xl_2 \Xl_3 \Xl_4} a \overbracket {\Xr_3 \Xr_2 \Xr_1 \Xl_2 \Xl_3 \Xl_4} a \overbracket {\Xr_3 \Xr_2 \Xr_1 \Xr_0}
        \end{aligned}
    \\
        & \quad\quad t_1 < t_2 < t_3 < t_4 < t_5 < t_7 < t_6 < t_8 < t_9
    \end{aligned}$
    };
\end{scope}


\begin{scope}[xshift=2.0in, yshift=-1.9in]
    \node [shape=rectangle, draw = none] (a) {
    \setlength\tabcolsep{1.5pt}
    \renewcommand{\arraystretch}{0.5}
    $\begin{aligned}
        &\begin{tabular}{cccccccc|c}
              $t_2$ & $t_3$ & $t_4$ & $t_5$ & $t_6$ & $t_7$ & $t_8$ & $t_9$ \\
              &&&&&&& \\[-0.4em]
              \hline
              &&&&&&& \\[-0.2em]
            %
                \begin{tabular}{cccc}
                -1 & \!-1 & 3 & 0 \\
                -1 & \!-1 & 2 & 0 \\
                \end{tabular}
            &
                \begin{tabular}{cccc}
                -1 & 3 & 3 & 0 \\
                -1 & 2 & 2 & 0 \\
                \end{tabular}
            &
                \begin{tabular}{cccc}
                -1 & 3 & 3 & 0 \\
                -1 & 2 & 2 & 0 \\
                \end{tabular}
            &
                \begin{tabular}{cccc}
                -1 & \!-1 & 3 & 0 \\
                -1 & \!-1 & 1 & 0 \\
                \end{tabular}
            &
                \begin{tabular}{cccc}
                -1 & 3 & 3 & 0 \\
                -1 & 1 & 1 & 0 \\
                \end{tabular}
            &
                \begin{tabular}{cccc}
                -1 & 3 & 3 & 0 \\
                -1 & 2 & 1 & 0 \\
                \end{tabular}
            &
                \begin{tabular}{cccc}
                -1 & 3 & 3 & 0 \\
                -1 & 1 & 1 & 0 \\
                \end{tabular}
            &
                \begin{tabular}{cccc}
                -1 & 3 & 3 & 0 \\
                -1 & 1 & 1 & 0 \\
                \end{tabular}
            & $\;t_1$
            \\[1em]
%
            &
                \begin{tabular}{cccc}
                -1 & 3 & 2 & 0 \\
                -1 & 2 & 2 & 0 \\
                \end{tabular}
            &
                \begin{tabular}{cccc}
                -1 & 3 & 2 & 0 \\
                -1 & 2 & 2 & 0 \\
                \end{tabular}
            &
                \begin{tabular}{cccc}
                -1 & \!-1 & 2 & 0 \\
                -1 & \!-1 & 1 & 0 \\
                \end{tabular}
            &
                \begin{tabular}{cccc}
                -1 & 3 & 2 & 0 \\
                -1 & 1 & 1 & 0 \\
                \end{tabular}
            &
                \begin{tabular}{cccc}
                -1 & 3 & 2 & 0 \\
                -1 & 2 & 1 & 0 \\
                \end{tabular}
            &
                \begin{tabular}{cccc}
                -1 & 3 & 2 & 0 \\
                -1 & 1 & 1 & 0 \\
                \end{tabular}
            &
                \begin{tabular}{cccc}
                -1 & 3 & 2 & 0 \\
                -1 & 1 & 1 & 0 \\
                \end{tabular}
            & $\;t_2$
            \\[1em]
%
            & &
                \begin{tabular}{cccc}
                -1 & \!-1 & 3 & 0 \\
                -1 & \!-1 & 2 & 0 \\
                \end{tabular}
            &\bf{
                \begin{tabular}{cccc}
%                \begin{tabular}{|cccc|}
%                \hline
                -1 & 2 & 2 & 0 \\
                -1 & 3 & 1 & 0 \\
%                \hline
                \end{tabular}
            }&
                \begin{tabular}{cccc}
                -1 & 2 & 2 & 0 \\
                -1 & 1 & 1 & 0 \\
                \end{tabular}
            &
                \begin{tabular}{cccc}
                -1 & \!-1 & 3 & 0 \\
                -1 & \!-1 & 1 & 0 \\
                \end{tabular}
            &
                \begin{tabular}{cccc}
                -1 & 2 & 2 & 0 \\
                -1 & 1 & 1 & 0 \\
                \end{tabular}
            &
                \begin{tabular}{cccc}
                -1 & 2 & 2 & 0 \\
                -1 & 1 & 1 & 0 \\
                \end{tabular}
            & $\;t_3$
            \\[1em]
%
            & & &
                \begin{tabular}{cccc}
                -1 & 2 & 2 & 0 \\
                -1 & 3 & 1 & 0 \\
                \end{tabular}
            &
                \begin{tabular}{cccc}
                -1 & 2 & 2 & 0 \\
                -1 & 1 & 1 & 0 \\
                \end{tabular}
            &
                \begin{tabular}{cccc}
                -1 & \!-1 & 2 & 0 \\
                -1 & \!-1 & 1 & 0 \\
                \end{tabular}
            &
                \begin{tabular}{cccc}
                -1 & 2 & 2 & 0 \\
                -1 & 1 & 1 & 0 \\
                \end{tabular}
            &
                \begin{tabular}{cccc}
                -1 & 2 & 2 & 0 \\
                -1 & 1 & 1 & 0 \\
                \end{tabular}
            & $\;t_4$
            \\[1em]
%
            & & & &
                \begin{tabular}{cccc}
                -1 & 3 & 1 & 0 \\
                -1 & 1 & 1 & 0 \\
                \end{tabular}
            &
                \begin{tabular}{cccc}
                -1 & 3 & 1 & 0 \\
                -1 & 2 & 1 & 0 \\
                \end{tabular}
            &
                \begin{tabular}{cccc}
                -1 & 3 & 1 & 0 \\
                -1 & 1 & 1 & 0 \\
                \end{tabular}
            &
                \begin{tabular}{cccc}
                -1 & 3 & 1 & 0 \\
                -1 & 1 & 1 & 0 \\
                \end{tabular}
            & $\;t_5$
            \\[1em]
%
            & & & & &
                \begin{tabular}{cccc}
                -1 & 1 & 1 & 0 \\
                -1 & 2 & 1 & 0 \\
                \end{tabular}
            &
                \begin{tabular}{cccc}
                -1 & \!-1 & 3 & 0 \\
                -1 & \!-1 & 2 & 0 \\
                \end{tabular}
            &
                \begin{tabular}{cccc}
                -1 & \!-1 & 3 & 0 \\
                -1 & \!-1 & 1 & 0 \\
                \end{tabular}
            & $\;t_6$
            \\[1em]
%
            & & & & & &
                \begin{tabular}{cccc}
                -1 & 2 & 1 & 0 \\
                -1 & 1 & 1 & 0 \\
                \end{tabular}
            &
                \begin{tabular}{cccc}
                -1 & 2 & 1 & 0 \\
                -1 & 1 & 1 & 0 \\
                \end{tabular}
            & $\;t_7$
            \\[1em]
%
            & & & & & & &
                \begin{tabular}{cccc}
                -1 & \!-1 & 2 & 0 \\
                -1 & \!-1 & 1 & 0 \\
                \end{tabular}
            & $\;t_8$
        \end{tabular}
    \end{aligned}$
    };
\end{scope}
\normalsize{
\node (w1)
    [ xshift=3.3in
    , yshift=-3.4in
    , draw=none
    , shape=rectangle
    ] {(e) --
        Pairwise comparison of all PEs for RE $(((a)^{1,3})^{1,3})^{1,3}$ and string $aaa$.
        The table contains $traces(\Phi_0(t_i), \Phi_0(t_j))$
    };
\node (w2)
    [ below of = w1
    , yshift=0.225in
    , draw=none
    , shape=rectangle
    ] {
        for PEs at row $t_i$, column $t_j$.
        IPTs $t_3$ and $t_5$ are shown in more detail (table entry in bold).
    };
}

\end{scope}
}

\end{tikzpicture}

\end{document}

